package com.zzz.demo.service.impl;

import com.ccpp.demo.entity.User;
import com.ccpp.demo.service.UserService;
import com.zzz.demo.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Set;

/**
 * @author ZZZ
 * @version 1.0
 * @date 2018/9/21 021
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUser(String userName) {
        return userMapper.getUserByUserName(userName);
    }

    @Override
    public User getUserByUserName(String userName) {
        return getUser(userName);
    }

    @Override
    public Set<String> getRoleByUserName(String userName) {
        return userMapper.getRoleByUserName(userName);
    }

    @Override
    public Set<String> getPermissionByUserName(String userName) {
        return userMapper.getPermissionByUserName(userName);
    }

    @Override
    public Object getUserById(int id) {
        return userMapper.getUserById(id);
    }
}
